<?
   $keyword = getValue('keyword','str','GET','');
   if($keyword != ''){
      $count_word = str_word_count($keyword);
      if($count_word < 4)
         $arr_product = searchProLike($keyword);
      else
         $arr_product = searchProFullText($keyword);
      $count_pro = count($arr_product);
?>
   <?if($count_pro > 0 ){?>
   <div class="main-content relative">
      <div>Tìm thấy <b><?=$count_pro?></b> sản phẩm liên quan đến "<?=$keyword?>"</div>
      <ul class="black-transparent list-pro">
         <?
         $i = 0;
         foreach($arr_product as $key=>$value){
            $i++;
            $pro_price = ($value['pro_price'] > 0) ? format_number($value['pro_price']) : 'Liên hệ';
            $link = rewriteDetailProduct($value['pro_name'],$value['pro_id']);
         ?>
            <li class="items-pro">
               <a href="<?=$link?>">
                  <?PrintImageThumbPro($value['pro_pic'],PATH_IMG_THUMB,'',$value['pro_name'])?>
                  <p><?=$value['pro_name']?></p>
                  <div class="op-product">
                     <span class="price-pro yellow"><?=$pro_price?></span>
                     <button class="relative">Chi tiết <em class="arrow-right"></em></button>
                  </div>
               </a>
            </li>
            <?if($i%3 == 0){?>
               <div class="line-ver clear-fix"></div>
            <?}?>
         <?}?>
      </ul>
   </div>
   <?}else{?>
      <div>Không tìm thấy kết quả liên quan !</div>
   <?}?>
<?}?>
